<?php
	session_start();
	require('game_functions.php');
	$gameid = $_GET['gameid'];
	
	dblogin();
	$query="
		select d.player, d.post_dt, d.post 
		from DISCUSSION d
		where d.game = ".$gameid;		
	$result = mysql_query($query);
	$no_results = true;
	while($row = mysql_fetch_array($result)){
		$no_results = false;
?>

<html>
<head>
<link rel="stylesheet" href="../Games/css/FNT_game_discussion.css" type="text/css" />
</head>
<body>
		<div id="message">
			<div id="from">
				<div id="name">
					<?php echo player_name($row['player']); ?>
				</div>
				<div id="date">
					<?php echo $row['post_dt']; ?>
				</div>
			</div>
			<div id="posthead">
			</div>
			<div id="post">
				<p><?php echo $row['post']; ?></p>
			</div>
			<div id="postfoot">
			</div>
		</div>
<?php		
	}
	if($no_results){
		echo 'No discussion yet! Add your 2 cents!<br>';
	}
	
?>
</body>